package com.probox.common.entity.vo.system;

import cn.hutool.core.util.ObjectUtil;
import com.probox.common.core.text.Convert;
import com.probox.common.core.utils.money.MoneyUtils;
import com.probox.common.entity.utils.DictUtils;
import lombok.Data;

import java.io.Serializable;
import java.util.HashMap;

@Data
public class WorkbenchItemVo implements Serializable {


    private Long detailId;

    private Long cardId;

    private Long serviceId;

    private Long subscribeId;

    private Long recordId;

    private Long skuId;

    private String skuName;

    private String dataStatus;

    /**
     * 项目名称
     */
    private String serviceName;

    private String type;

    /**
     * 类型
     */
    private String serviceType;

    /**
     * 正常时间
     */
    private Long itemServiceDuration;

    /**
     * 叠加时间
     */
    private Long itemComposeDuration;

    private String isLockDevice;

    /**
     * 技师id
     */
    private Long technicianId;

    private String technicianName;

    private Long settlementPrice;

    private String isDdl;

    /**
     * 数量
     */
    private Long itemNumber;


    private String itemMainImage;


    private Long favorablePrice;


    private Long price;

    public String getPriceStr() {
        if (ObjectUtil.isEmpty(favorablePrice)) {
            if (ObjectUtil.isEmpty(price)) {
                return "0";
            }
            return "0";
        }
        if (favorablePrice > 0) {
            return MoneyUtils.changeF2Y(favorablePrice);
        } else {
            return MoneyUtils.changeF2Y(price);
        }
    }

    /**
     * 结算价
     *
     * @return
     */
    public String getSettlementPriceStr() {
        if (ObjectUtil.isEmpty(settlementPrice)) {
            return "";
        }
        return MoneyUtils.changeF2Y(settlementPrice);
    }

    private String isMaster;


    /**
     * 是否限制数量(0限制,1不限制)
     */
    private String isUnLimit;

    /**
     * 配台人id
     */
    private Long matchingId;
    private String matchingName;

    /**
     * 洁面人id
     */
    private Long cleansingId;
    private String cleansingName;

    /**
     * 次数
     */
    private Long times;

    /**
     * 总是用次数
     */
    private Long countTimes;

    private String applyStoreType;

    public String getApplyStoreTypeStr() {
        HashMap dictCacheMap = DictUtils.getDictCacheMap("item_apply_store_type");
        return Convert.toStr(dictCacheMap.get(applyStoreType));
    }

    /**
     * 核销码
     */
    private String orderNo;
    /**
     * 凭证
     */
    private String voucherImg;

}
